package com.zzyd.factory.presenter.home;

import android.util.Log;

import com.zzyd.common.mvp.data.DataSource;
import com.zzyd.common.mvp.presenter.BasePresenter;
import com.zzyd.factory.data.market.MarketBean;
import com.zzyd.factory.net.mainmsg.MsgInfoHelper;

/**
 * @author wjunjie
 * @version 1.0
 * @E-mail wang_junjie007@163.com
 * @company ZZYD
 * @createTime 2018/8/28 17:53
 * @类注释:
 */
public class MmPresenter extends BasePresenter<MmContract.MmView> implements MmContract.Persenter, DataSource.CallBack<MarketBean> {
    public MmPresenter(MmContract.MmView view) {
        super(view);
    }

    @Override
    public void getMarkerInfo(String coinId) {
        MsgInfoHelper.getMsg(coinId, this);
    }

    @Override
    public void onDataLoaded(MarketBean bean) {
        MmContract.MmView view = getView();
        if (view != null) {
            view.onInfoDone(bean);

        }
    }

    @Override
    public void onDataNotAvailable(int str) {
        MmContract.MmView view = getView();
        if (view!=null){
            view.showError(str);
        }
    }
}
